package com.mall.group_booking.feign;

import com.mall.common.annotation.IngoreResponseAdvice;
import com.mall.entity.TbItem;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author: W
 * @date: 2021/07/21/19:16
 * Other:
 */
@FeignClient("product")
@RequestMapping("/item")
public interface ItemFeignService {

    /**
     * 找到一个商品
     *
     * @param id id
     * @return {@link TbItem}
     */
    @GetMapping("/findOne")
    @IngoreResponseAdvice
    public TbItem findOne(@RequestParam("id")Long id);

    /**
     * 发现通过商品id
     *
     * @param goodsId 商品id
     * @return {@link TbItem}
     */
    @GetMapping("/findByGoodsId")
    @IngoreResponseAdvice
    TbItem findByGoodsId(@RequestParam("goodsId")Long goodsId);

    /**
     * 更新
     *
     * @param item 项
     */
    @PutMapping("/update")
    @IngoreResponseAdvice
    void update(@RequestBody TbItem item);
}
